//
//  NSString+URL.m
//  YanzhouCloud
//
//  Created by Cocoa on 2019/7/2.
//  Copyright © 2019 yibai. All rights reserved.
//

#import "NSString+URL.h"
#import "YBApiManager.h"
@implementation NSString (URL)
- (NSURL *)toURL {
    return [NSURL URLWithString:self];
}
- (NSURL *)h5ToURL {
    
    NSURL *url = [NSURL URLWithString:self];
    if (url.scheme.length <= 0) {
        return [NSURL URLWithString:[NSString stringWithFormat:@"http://%@", self]];
    } else {
        return url;
    }
}

- (NSURL *)imgToURL {
    NSString *photo_url = [NSString stringWithFormat:@"%@/%@", ImageHost, self];
    NSLog(@"photo_url = %@", photo_url);
    return [NSURL URLWithString:photo_url];
}
- (NSURL *)fileToURL {
    return [NSURL fileURLWithPath:self];
}
@end
